package com.info.zhiduoduo.common.excelconverter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * 实名认证 1.未认证 2:认证中 3:认证失败 4:已认证 5:已开户
 */
public class MakerRealNameAuthConverter implements Converter<Integer> {

	@Override
	public Class supportJavaTypeKey() {
		return null;
	}

	@Override
	public CellDataTypeEnum supportExcelTypeKey() {
		return null;
	}

	@Override
	public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty,
	                                 com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) throws Exception {
		return 0;
	}

	@Override
	public CellData convertToExcelData(Integer integer, ExcelContentProperty excelContentProperty,
	                                   com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) throws Exception {
		if (integer == null) {
			return new CellData("");
		} else if (integer == 1) {
			return new CellData("未认证");
		} else if (integer == 2) {
			return new CellData("认证中");
		} else if (integer == 3) {
			return new CellData("认证失败");
		} else if (integer == 4) {
			return new CellData("已实名");
		} else if (integer == 5) {
			return new CellData("开户中");
		} else if (integer == 98) {
			return new CellData("已开税户");
		} else if (integer == 99) {
			return new CellData("已开工商户");
		} else {
			return new CellData("");
		}
	}
}
